<?php

namespace App\Models;



class Star extends Base
{
    const TYPE_Work = 1;
    const TYPE_MATERIAL = 2;
    const TYPE_SERVICE = 3;

    protected $fillable = ['user_id', 'entity_id', 'type', 'entity_user_id'];

    public function user() {
        return $this->belongsTo(User::class, 'user_id');
    }

    public function cookbook() {
        return $this->belongsTo(Cookbook::class, 'entity_id');
    }

}
